package com.XmlParse;

import com.Data.XmlData;
import com.UIManager.UIManager;
import com.Welcome.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class XmlParseResultValue extends Activity {

	private Intent intent = null;
	private Bundle bundle = null;
	private UIManager manager = null;
	private XmlData xmlData = null;
	private Thread thread = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.xmlparsevalue);
		intent = getIntent();
		bundle = intent.getExtras();
		System.out.println(bundle.getInt("Position"));
		manager = new UIManager(this);
		xmlData = new XmlData();
		thread = new Thread(xmlData);
		thread.start();

		manager.getNewsTitle().setText(
				xmlData.URLReadXmlByPull().get(bundle.getInt("Position"))
						.getTitle().toString().trim());
		manager.getNewsData().setText(
				xmlData.URLReadXmlByPull().get(bundle.getInt("Position"))
						.getPubDate().toString().trim());
		manager.getNewsAuthor().setText(
				xmlData.URLReadXmlByPull().get(bundle.getInt("Position"))
						.getAuthor().toString().trim());
		manager.getNewsInner().setText(
				xmlData.URLReadXmlByPull().get(bundle.getInt("Position"))
						.getDescription().toString().trim());

	}

	@Override
	protected void onDestroy() {
		thread.stop();
		super.onDestroy();
	}

}
